package com.huluobo.a2110mvvmjetpackdemo2.viewbinding;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewbinding.ViewBinding;

/**
 * Created by LC on 2024/1/2.
 */
public abstract class BaseActivity<T extends ViewBinding> extends AppCompatActivity {
    protected T viewBinding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        viewBinding = getViewBinding();
        setContentView(viewBinding.getRoot());

        initView();
        initData();
    }

    protected abstract void initData();

    protected abstract void initView();

    protected abstract T getViewBinding();
}
